package com.cn.kehong.controller;


import com.cn.kehong.api.IPlanYearDetailService;
import com.cn.kehong.api.IPlanYearService;
import com.cn.kehong.domain.PlanYear;
import com.cn.kehong.domain.PlanYearDetail;
import com.cn.kehong.utils.CommonUtil;
import com.cn.kehong.utils.JsonResponse;
import com.cn.kehong.utils.QueryForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/planDetailYear")
public class PlanYearDetailController {

    @Autowired
    private IPlanYearDetailService planYearDetailService;

    @RequestMapping("/getPlanYearList/{frontToken}")
    @ResponseBody
    public JsonResponse<List<PlanYearDetail>> getPlanYearDetails(String planYearId, @PathVariable(value = "frontToken",required = true) String frontToken) throws Exception {
        JsonResponse<List<PlanYearDetail>> response = new JsonResponse<List<PlanYearDetail>>();
        List<PlanYearDetail> list  = planYearDetailService.getPlanYearDetails(planYearId);
        response.setResult(list);
        response.setSuccess(true);
        return  response;
    }

}
